<!DOCTYPE html >
<html>
<head>
    <link rel="stylesheet" href="demos.css" type="text/css" media="screen" />
    
    <script type="text/javascript" src="../libraries/RGraph.common.core.js" ></script>
    <script type="text/javascript" src="../libraries/RGraph.common.csv.js" ></script>
    <script type="text/javascript" src="../libraries/RGraph.scatter.js" ></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <!--[if lt IE 9]><script src="../excanvas/excanvas.js"></script><![endif]-->
    
    <title>A Scatter chart using the CSV reader</title>


    <meta name="robots" content="noindex,nofollow" />
    <meta name="description" content="A Scatter chart using the CSV reader" />
     
</head>
<body>

    <h1>A Scatter chart using the CSV reader</h1>

    <div style="background-color: #ffc; border: 2px solid #cc0; border-radius: 5px; padding: 5px;">
        <b>Note:</b>
        For browser security reasons the AJAX demos don't work offline. You can view the demos on the RGraph website here:
        <a href="http://www.rgraph.net/demos/" target="_blank" rel="nofollow">http://www.rgraph.net/demos</a>
    </div>
    <canvas id="cvs" width="500" height="250">[No canvas support]</canvas>
    
    <script>
        $(document).ready(function ()
        {
            RGraph.CSV('/sample.csv', function (csv)
            {
                // Just fetch the two rows of the CSV file, starting at the second column
                var row1 = csv.getRow(0, 1); // First row
                var row2 = csv.getRow(1, 1); // Second row
                var data = [];
                
                
                
                /**
                * Now make up some sample points using the data
                */
                for (var i=0; i<row1.length; ++i) {
                    data.push([row1[i], row2[i]]);
                }


                var scatter = new RGraph.Scatter({
                    id: 'cvs',
                    data: data,
                    options: {
                        xmax: 10,
                        xscale: true
                    }
                }).draw()
            })
        })
    </script>

    <p>
        <a href="./">&laquo; Back</a>
    </p>

</body>
</html>